home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.4 KB | 117 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ClockFra.h
- // Release Version: $ 1.0d11 $
- //
- // Author: Lonnie Millett
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CLOCKFRA_H
- #define CLOCKFRA_H
-
- // ----- Framework Includes -----
-
- #ifndef FWFRAME_H
- #include "FWFrame.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTRING_H
- #include "FWString.h"
- #endif
-
- // ----- Graphic Includes -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWMAPING_H
- #include "FWMaping.h"
- #endif
-
- //========================================================================================
- // Classes defined in this interface
- //========================================================================================
-
- class FW_CLASS_ATTR CClockFrame;
-
- //========================================================================================
- // Classes used by this interface
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import on
- #endif
- class FW_CLASS_ATTR ODFrame;
- class FW_CLASS_ATTR ODShape;
- class FW_CLASS_ATTR ODFacet;
- class FW_CLASS_ATTR FW_CTime;
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import off
- #endif
-
- class FW_CLASS_ATTR CClockPart;
-
- //========================================================================================
- // CClockFrame
- //========================================================================================
-
- class FW_CLASS_ATTR CClockFrame : public FW_CFrame
- {
- public:
-
- FW_DECLARE_CLASS
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- CClockFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CClockPart* clockPart);
- virtual ~ CClockFrame();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void FacetAdded(Environment* ev, ODFacet* facet);
- virtual void FrameShapeChanged(Environment* ev);
- virtual void Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
- virtual ODShape* AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
- virtual ODShape* AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void UpdateAnalogClock(Environment* ev, FW_CFacetContext& fc, const FW_CTime& time);
- void UpdateDigitalClock(Environment* ev, FW_CFacetContext& fc, const FW_CTime& time);
-
- void UpdateClock(Environment* ev, const FW_CTime& time);
-
- void ChangeClockType(Environment* ev, short newClockType);
-
- private:
- void DrawClockFace(Environment* ev, FW_CFacetContext& fc);
- void DrawHourHand(Environment* ev, FW_CFacetContext& fc, FW_CFixed hour, FW_CFixed minute);
- void DrawMinuteHand(Environment* ev, FW_CFacetContext& fc, FW_CFixed minute);
- void DrawSecondHand(Environment* ev, FW_CFacetContext& fc, FW_CFixed second);
-
- void ResetMapping(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CClockPart* fClockPart;
- FW_CRect fDigitalClockRect;
- FW_CString32 fFaceString;
- FW_CMapping fMapping;
- FW_CRect fAnalogUsedRect;
- };
-
- #endif
-